const pool = require('./db.js')
class birdsDao {
  // 根据鸟类图鉴id获取鸟类图鉴
  async getBirds(id){
    try{
      let result = {}
      result = await pool.execute('select * from bird_encyclopedia where id = ?',[id])
      return result
    }catch(err){
      console.log('出错:' + err)
    }
  }
    // 获取鸟类图鉴列表
    async getAllBirds(id){
      try{
        let result = {}
        result = await pool.execute('select * from bird_encyclopedia')
        return result
      }catch(err){
        console.log('出错:' + err)
      }
    }
}
module.exports = new birdsDao()